package com.example.mobile2021606170hsy0324homework;

        import androidx.appcompat.app.AppCompatActivity;

        import android.os.Bundle;
        import  android.view.View;
        import  android.widget.Button;
        import android.widget.EditText;
        import android.widget.TextView;
        import  android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
 final TextView helloTextView= (TextView)findViewById(R.id.tv_main_title);
 final EditText editTextname=(EditText)findViewById(R.id.tv_main_account);
 final EditText editTextpsw=(EditText)findViewById(R.id.et_original_psw);
 final EditText editText3=(EditText)findViewById(R.id.editText3);
 final EditText editText4=(EditText)findViewById(R.id.editText4);
 Button buttonl=findViewById(R.id.button);
 buttonl.setOnClickListener(new View.OnClickListener() {
     @Override
     public void onClick(View view) {
         String str=editTextname.getText().toString();
         String str1=editTextpsw.getText().toString();
         String str2=editText3.getText().toString();
         String str3=editText4.getText().toString();


         if (str1.equals("123456")){
             if (str2.equals(str3)){
                 Toast.makeText(MainActivity.this, "修改成功", Toast.LENGTH_SHORT).
                         show();
             }else{
                 editText4.setText("两次密码不一致，请重新输入");
             }
         }else{
                 editText3.setText("原密码错误");
                 }
     }
 });


  }

    }

